import { createRouter, createWebHistory } from "vue-router";
import nProgress from "@/utils/nprogress";

export const routers = [
  {
    path: "/vrsite|/",
    name: "vrsite",
    component: () => import("@/views/vrsite/home.vue")
  },
  {
    path: "/siteroom",
    name: "siteroom",
    component: () => import("@/views/vrsite/siteroom.vue")
  },
  {
    path: "/demo",
    component: () => import("@/views/demo.vue")
  }
];

const router = createRouter({
  history: createWebHistory(),
  routes: routers
});

router.beforeEach((to, from, next) => {
  nProgress.start();
  next();
});

router.beforeEach((to, from, next) => {
  nProgress.done();
  next();
});

export default router;
